package com.aclyyx.mi.display.listener;

import com.aclyyx.mi.display.DicObj;
import com.aclyyx.mi.display.FirstActivity;
import com.aclyyx.mi.display.MiActivity;
import com.aclyyx.mi.display.Param;
import android.content.Intent;
import android.view.View;

public class MineStart implements View.OnClickListener {
	
	public FirstActivity a;
	
	public MineStart(FirstActivity context) {
		this.a = context;
	}

	@Override
	public void onClick(View v) {
//		Toast.makeText(a, "r:" + a.editRow1.getText().toString() 
//				+ "c:" + a.editColumn1.getText().toString() 
//				+ "mr:" + a.editMyRow1.getText().toString() 
//				+ "mc:" + a.editMyColumn1.getText().toString() 
//				+ "stlye:" + ((DicObj) a.spStlye1.getSelectedItem()).getDescription()
//				+ "", Toast.LENGTH_LONG).show();
		Param param		= new Param();
		param.run_type = Param.RUN_TYPE_LOCAL;
		param.s			= a.editString1.getText().toString();
		param.size		= Integer.valueOf(a.editSize1.getText().toString());
		param.row		= Integer.valueOf(a.editRow1.getText().toString());
		param.column	= Integer.valueOf(a.editColumn1.getText().toString());
		param.myRow		= Integer.valueOf(a.editMyRow1.getText().toString());
		param.myColumn	= Integer.valueOf(a.editMyColumn1.getText().toString());
		param.stlye		= ((DicObj) a.spStlye1.getSelectedItem()).getId();
		param.fcolor	= Param.CS[a.spFcolor1.getSelectedItemPosition()];
		param.bcolor	= Param.CS[a.spBcolor1.getSelectedItemPosition()];
		param.dpx		= ((DicObj) a.spDpx1.getSelectedItem()).getId();
		param.hvFlag	= Integer.valueOf(((DicObj) a.spStlye4.getSelectedItem()).getId());

		param.setMyWH(param.dpx, param.hvFlag);

		Intent i = new Intent(a, MiActivity.class);
		i.putExtra("param", param);
		i.putExtra("sign", true);
		a.startActivity(i);
	}
}
